from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.remote.webdriver import WebDriver

def getElementById(driver: WebDriver, element_id: str) -> WebElement:
    return driver.find_element(By.ID, element_id)

def getElementByXPath(driver: WebDriver, xpath: str) -> WebElement:
    return driver.find_element(By.XPATH, xpath)

def getElementsByXPath(driver: WebDriver, xpath: str) -> list[WebElement]:
    return driver.find_elements(By.XPATH, xpath)

def getElementByClassName(driver: WebDriver, class_name: str) -> WebElement:
    return driver.find_element(By.CLASS_NAME, class_name)

def getElementsByClassName(driver: WebDriver, class_name: str) -> list[WebElement]:
    return driver.find_elements(By.CLASS_NAME, class_name)

def getElementByTagName(driver: WebDriver, name: str) -> WebElement:
    return driver.find_element(By.TAG_NAME, name)

def getElementsByTagName(driver: WebDriver, name: str) -> list[WebElement]:
    return driver.find_elements(By.TAG_NAME, name)

def getElementByCssSelector(driver: WebDriver, selector: str) -> WebElement:
    return driver.find_element(By.CSS_SELECTOR, selector)

def getElementsByCssSelector(driver: WebDriver, selector: str) -> list[WebElement]:
    return driver.find_elements(By.CSS_SELECTOR, selector)

def getElementByName(driver: WebDriver, name: str) -> WebElement:
    return driver.find_element(By.NAME, name)

def getElementsByName(driver: WebDriver, name: str) -> list[WebElement]:
    return driver.find_elements(By.NAME, name)

def fillElementInput(element: WebElement, value: str) -> None:
    element.clear()
    element.send_keys(value)
